package com.binest.socialMediaConnection.service.impl;

import java.util.List;
import com.binest.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.binest.socialMediaConnection.mapper.SocialMediaConnectionMapper;
import com.binest.socialMediaConnection.domain.SocialMediaConnection;
import com.binest.socialMediaConnection.service.ISocialMediaConnectionService;

/**
 * 社媒链接Service业务层处理
 * 
 * @author wwd
 * @date 2024-01-16
 */
@Service
public class SocialMediaConnectionServiceImpl implements ISocialMediaConnectionService 
{
    @Autowired
    private SocialMediaConnectionMapper socialMediaConnectionMapper;

    /**
     * 查询社媒链接
     * 
     * @param id 社媒链接主键
     * @return 社媒链接
     */
    @Override
    public SocialMediaConnection selectSocialMediaConnectionById(String id)
    {
        return socialMediaConnectionMapper.selectSocialMediaConnectionById(id);
    }

    @Override
    public List<SocialMediaConnection> selectSocialMediaConnectionByInId(String inclusionId)
    {
        return socialMediaConnectionMapper.selectSocialMediaConnectionByInId(inclusionId);
    }

    /**
     * 查询社媒链接列表
     * 
     * @param socialMediaConnection 社媒链接
     * @return 社媒链接
     */
    @Override
    public List<SocialMediaConnection> selectSocialMediaConnectionList(SocialMediaConnection socialMediaConnection)
    {
        return socialMediaConnectionMapper.selectSocialMediaConnectionList(socialMediaConnection);
    }

    /**
     * 新增社媒链接
     * 
     * @param socialMediaConnection 社媒链接
     * @return 结果
     */
    @Override
    public int insertSocialMediaConnection(SocialMediaConnection socialMediaConnection)
    {
        socialMediaConnection.setCreateTime(DateUtils.getNowDate());
        return socialMediaConnectionMapper.insertSocialMediaConnection(socialMediaConnection);
    }

    /**
     * 修改社媒链接
     * 
     * @param socialMediaConnection 社媒链接
     * @return 结果
     */
    @Override
    public int updateSocialMediaConnection(SocialMediaConnection socialMediaConnection)
    {
        socialMediaConnection.setUpdateTime(DateUtils.getNowDate());
        return socialMediaConnectionMapper.updateSocialMediaConnection(socialMediaConnection);
    }

    /**
     * 批量删除社媒链接
     * 
     * @param ids 需要删除的社媒链接主键
     * @return 结果
     */
    @Override
    public int deleteSocialMediaConnectionByIds(String[] ids)
    {
        return socialMediaConnectionMapper.deleteSocialMediaConnectionByIds(ids);
    }

    /**
     * 删除社媒链接信息
     * 
     * @param id 社媒链接主键
     * @return 结果
     */
    @Override
    public int deleteSocialMediaConnectionById(String id)
    {
        return socialMediaConnectionMapper.deleteSocialMediaConnectionById(id);
    }
}
